home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 24
/
Aminet 24 (1998)(GTI - Schatztruhe)[!][Apr 1998].iso
/
Aminet
/
dev
/
c
/
AmiVoGL_MDEV.lha
/
hershey
/
src
/
htext.s
< prev
next >
Wrap
Text File
|
1997-12-30
|
18KB
|
1,265 lines
; Maxon C++ Compiler
; LS2:work/voGL/hershey/src/htext.c
mc68020
mc68881
XREF _rmv
XREF _move2
XREF _gexit
XREF _rdr
XREF _hallocate
XREF _check_loaded
XREF _strlen
XREF _strrchr
XREF _strcmp
XREF _strcat
XREF _strcpy
XREF _getenv
XREF _free
XREF _cos__r
XREF _sin__r
XREF _exit
XREF _fread
XREF _fprintf
XREF _fclose
XREF _fopen
XREF _std__in
XREF _std__out
XREF _std__err
XREF ___MEMFLAGS
XREF _vdevice
SECTION ":0",CODE
XDEF _hfont
_hfont
L57 EQU -$8
link a5,#L57+8
L58 EQU $C00
movem.l a2/a3,-(a7)
move.l $8(a5),a2
XREF userbreak_flagpos
move.l userbreak_flagpos,a1
btst #4,(a1)
bne L59
cmp.b #$2F,(a2)
bne L2
pea _old_font
pea $2F.w
move.l a2,-(a7)
jsr _strrchr
addq.l #$8,a7
move.l d0,a3
addq.l #1,a3
move.l a3,-(a7)
jsr _strcmp
addq.l #$8,a7
tst.l d0
bne L1
movem.l (a7)+,a2/a3
unlk a5
rts
L1
bra.b L4
L2
pea _old_font
move.l a2,-(a7)
jsr _strcmp
addq.l #$8,a7
tst.l d0
bne L3
movem.l (a7)+,a2/a3
unlk a5
rts
L3
L4
move.l a2,-(a7)
jsr _hershfont
addq.l #4,a7
tst.l d0
bne L5
move.l a2,-(a7)
pea L60
pea _std__err
jsr _fprintf
lea $C(a7),a7
jsr _gexit
pea 1.w
jsr _exit
addq.l #4,a7
L5
cmp.b #$2F,(a2)
bne L6
pea $2F.w
move.l a2,-(a7)
jsr _strrchr
addq.l #$8,a7
move.l d0,a3
addq.l #1,a3
move.l a3,-(a7)
pea _old_font
jsr _strcpy
addq.l #$8,a7
bra L7
L6
move.l a2,-(a7)
pea _old_font
jsr _strcpy
addq.l #$8,a7
L7
movem.l (a7)+,a2/a3
unlk a5
rts
XDEF _hnumchars
_hnumchars
L61 EQU 0
L62 EQU 0
move.l userbreak_flagpos,a1
btst #4,(a1)
bne L59
pea L63
jsr _check_loaded
addq.l #4,a7
move.w _nchars,d0
ext.l d0
rts
XDEF _hsetpath
_hsetpath
L64 EQU -$C
link a5,#L64+8
L65 EQU $804
movem.l d2/a3,-(a7)
move.l userbreak_flagpos,a1
btst #4,(a1)
bne L59
move.l $8(a5),-(a7)
pea _fpath
jsr _strcpy
addq.l #$8,a7
pea _fpath
jsr _strlen
addq.l #4,a7
move.l d0,d2
move.l #_fpath,a3
cmp.b #$2F,0(a3,d2.l)
beq L8
move.l #_fpath,a3
cmp.b #$3A,0(a3,d2.l)
beq L8
pea L66
pea _fpath
jsr _strcat
addq.l #$8,a7
L8
movem.l (a7)+,d2/a3
unlk a5
rts
_hershfont
L67 EQU -$124
link a5,#L67+20
L68 EQU $4C84
movem.l d2/d7/a2/a3/a6,-(a7)
move.l userbreak_flagpos,a1
btst #4,(a1)
bne L59
move.l #_fpath,a3
tst.b (a3)
beq L9
pea _fpath
pea -$110(a5)
jsr _strcpy
addq.l #$8,a7
move.l $8(a5),-(a7)
pea -$110(a5)
jsr _strcat
addq.l #$8,a7
bra L17
L9
pea L69
jsr _getenv
addq.l #4,a7
move.l d0,a6
cmp.w #0,a6
beq L11
move.l a6,-(a7)
pea -$110(a5)
jsr _strcpy
addq.l #$8,a7
lea -$110(a5),a3
pea -$110(a5)
jsr _strlen
addq.l #4,a7
subq.l #1,d0
cmp.b #$3A,0(a3,d0.l)
beq L10
pea L66
pea -$110(a5)
jsr _strcat
addq.l #$8,a7
L10
move.l $8(a5),-(a7)
pea -$110(a5)
jsr _strcat
addq.l #$8,a7
bra L16
L11
pea L70
jsr _getenv
addq.l #4,a7
move.l d0,a6
cmp.w #0,a6
beq L13
move.l a6,-(a7)
pea -$110(a5)
jsr _strcpy
addq.l #$8,a7
lea -$110(a5),a3
pea -$110(a5)
jsr _strlen
addq.l #4,a7
subq.l #1,d0
cmp.b #$3A,0(a3,d0.l)
beq L12
pea L66
pea -$110(a5)
jsr _strcat
addq.l #$8,a7
L12
move.l $8(a5),-(a7)
pea -$110(a5)
jsr _strcat
addq.l #$8,a7
bra L15
L13
pea L71
pea -$110(a5)
jsr _strcpy
addq.l #$8,a7
lea -$110(a5),a3
pea -$110(a5)
jsr _strlen
addq.l #4,a7
subq.l #1,d0
cmp.b #$3A,0(a3,d0.l)
beq L14
pea L66
pea -$110(a5)
jsr _strcat
addq.l #$8,a7
L14
move.l $8(a5),-(a7)
pea -$110(a5)
jsr _strcat
addq.l #$8,a7
L15
L16
L17
pea L72
pea -$110(a5)
jsr _fopen
addq.l #$8,a7
move.l d0,a2
cmp.w #0,a2
bne L18
pea L72
move.l $8(a5),-(a7)
jsr _fopen
addq.l #$8,a7
move.l d0,a2
cmp.w #0,a2
bne L18
move.l $8(a5),-(a7)
pea -$110(a5)
pea L73
pea _std__err
jsr _fprintf
lea $10(a7),a7
pea 1.w
jsr _exit
addq.l #4,a7
L18
move.l a2,-(a7)
pea 1.w
pea 2.w
pea _nchars
jsr _fread
lea $10(a7),a7
cmp.l #1,d0
beq L19
moveq #0,d0
movem.l (a7)+,d2/d7/a2/a3/a6
unlk a5
rts
L19
move.l a2,-(a7)
pea 1.w
pea 2.w
pea -$A(a5)
jsr _fread
lea $10(a7),a7
cmp.l #1,d0
beq L20
moveq #0,d0
movem.l (a7)+,d2/d7/a2/a3/a6
unlk a5
rts
L20
move.l a2,-(a7)
pea 1.w
pea 2.w
pea -$C(a5)
jsr _fread
lea $10(a7),a7
cmp.l #1,d0
beq L21
moveq #0,d0
movem.l (a7)+,d2/d7/a2/a3/a6
unlk a5
rts
L21
move.w -$C(a5),d0
ext.l d0
move.l d0,_ftab
move.l a2,-(a7)
pea 1.w
pea 2.w
pea -$C(a5)
jsr _fread
lea $10(a7),a7
cmp.l #1,d0
beq L22
moveq #0,d0
movem.l (a7)+,d2/d7/a2/a3/a6
unlk a5
rts
L22
move.w -$C(a5),d0
ext.l d0
move.l d0,_ftab+4
move.l a2,-(a7)
pea 1.w
pea 2.w
pea -$C(a5)
jsr _fread
lea $10(a7),a7
cmp.l #1,d0
beq L23
moveq #0,d0
movem.l (a7)+,d2/d7/a2/a3/a6
unlk a5
rts
L23
move.w -$C(a5),d0
ext.l d0
move.l d0,_ftab+$8
tst.l _hLoaded
beq L26
move.l _ftab+$10,a3
moveq #0,d0
tst.l 0(a3,d0.l*4)
beq L24
move.l _ftab+$10,a3
moveq #0,d0
move.l 0(a3,d0.l*4),-(a7)
jsr _free
addq.l #4,a7
L24
tst.l _ftab+$10
beq L25
move.l _ftab+$10,-(a7)
jsr _free
addq.l #4,a7
L25
clr.l _hLoaded
L26
move.w _nchars,d0
ext.l d0
addq.l #1,d0
asl.l #2,d0
move.l d0,-(a7)
jsr _hallocate
addq.l #4,a7
move.l d0,_ftab+$10
move.w -$A(a5),d0
ext.l d0
add.l d0,d0
move.l d0,-(a7)
jsr _hallocate
addq.l #4,a7
move.l d0,_ftab+$C
moveq #0,d2
bra L28
L27
move.l a2,-(a7)
pea 1.w
pea 2.w
pea -$C(a5)
jsr _fread
lea $10(a7),a7
cmp.l #1,d0
beq L30
moveq #0,d0
movem.l (a7)+,d2/d7/a2/a3/a6
unlk a5
rts
L30
move.l a2,-(a7)
move.w -$C(a5),d0
ext.l d0
move.l d0,-(a7)
pea 1.w
move.l _ftab+$C,-(a7)
jsr _fread
lea $10(a7),a7
move.w -$C(a5),d7
ext.l d7
cmp.l d7,d0
beq L31
moveq #0,d0
movem.l (a7)+,d2/d7/a2/a3/a6
unlk a5
rts
L31
move.l _ftab+$10,a3
move.l _ftab+$C,0(a3,d2.l*4)
move.w -$C(a5),d0
ext.l d0
add.l d0,_ftab+$C
L29
addq.l #1,d2
move.l userbreak_flagpos,a1
btst #4,(a1)
bne L59
L28
move.w _nchars,d0
ext.l d0
cmp.l d0,d2
blt L27
move.l _ftab+$10,a3
move.w _nchars,d0
ext.l d0
move.l _ftab+$C,0(a3,d0.l*4)
move.l a2,-(a7)
jsr _fclose
addq.l #4,a7
move.l #1,_hLoaded
moveq #1,d0
movem.l (a7)+,d2/d7/a2/a3/a6
unlk a5
rts
XDEF _hgetcharsize
_hgetcharsize
L74 EQU $24
L75 EQU $4CC4
movem.l d2/d6/d7/a2/a3/a6,-(a7)
fmovem.x fp7,-(a7)
move.b L74+4(a7),d2
move.l L74+6(a7),a2
move.l userbreak_flagpos,a1
btst #4,(a1)
bne L59
pea L76
jsr _check_loaded
addq.l #4,a7
move.l _ftab,d7
sub.l _ftab+4,d7
fmove.l d7,fp7
fmul.s _SCSIZEY,fp7
move.l L74+$A(a7),a3
fmove.s fp7,(a3)
tst.l _Fixedwidth
beq L32
fmove.l _ftab+$8,fp7
fmul.s _SCSIZEX,fp7
fmove.s fp7,(a2)
bra L33
L32
move.l _ftab+$10,a3
extb.l d2
move.l d2,d7
sub.l #$20,d7
move.l 0(a3,d7.l*4),a6
move.b 1(a6),d7
extb.l d7
move.l _ftab+$10,a3
extb.l d2
move.l d2,d6
sub.l #$20,d6
move.l 0(a3,d6.l*4),a6
move.b (a6),d6
extb.l d6
sub.l d6,d7
fmove.l d7,fp7
fmul.s _SCSIZEX,fp7
fmove.s fp7,(a2)
L33
fmovem.x (a7)+,fp7
movem.l (a7)+,d2/d6/d7/a2/a3/a6
rts
XDEF _hdrawchar
_hdrawchar
L77 EQU -$78
link a5,#L77+60
L78 EQU $4CFC
movem.l d2-d7/a2/a3/a6,-(a7)
fmovem.x fp6/fp7,-(a7)
move.l userbreak_flagpos,a1
btst #4,(a1)
bne L59
pea L79
jsr _check_loaded
addq.l #4,a7
move.l $8(a5),d7
sub.l #$20,d7
move.l d7,-$10(a5)
cmp.l #0,-$10(a5)
bge L34
clr.l -$10(a5)
L34
move.l -$10(a5),d7
move.w _nchars,d6
ext.l d6
cmp.l d6,d7
blt L35
move.w _nchars,d7
ext.l d7
subq.l #1,d7
move.l d7,-$10(a5)
L35
moveq #1,d4
clr.l -$20(a5)
move.l -$20(a5),-$1C(a5)
tst.l _Justify
bne L36
tst.l _Fixedwidth
beq L80
move.l _ftab+$8,d0
neg.l d0
divs.l #2,d0
bra.b L81
L80
move.l _ftab+$10,a3
move.l -$10(a5),d7
move.l 0(a3,d7.l*4),a6
move.b (a6),d7
extb.l d7
sub.l #$52,d7
move.l d7,d0
L81
move.l d0,-$1C(a5)
move.l _ftab+4,-$20(a5)
bra L38
L36
cmp.l #2,_Justify
bne L37
tst.l _Fixedwidth
beq L82
move.l _ftab+$8,d0
divs.l #2,d0
bra.b L83
L82
move.l _ftab+$10,a3
move.l -$10(a5),d7
move.l 0(a3,d7.l*4),a6
move.b (a6),d7
extb.l d7
sub.l #$52,d7
neg.l d7
move.l d7,d0
L83
move.l d0,-$1C(a5)
move.l _ftab+4,-$20(a5)
L37
L38
move.l _ftab+$10,a3
move.l -$10(a5),d7
addq.l #1,d7
move.l 0(a3,d7.l*4),-$8(a5)
move.l _ftab+$10,a3
move.l -$10(a5),d7
move.l 0(a3,d7.l*4),a6
addq.l #2,a6
move.l a6,a2
clr.l -$3C(a5)
move.l -$3C(a5),-$38(a5)
bra L40
L39
move.b (a2)+,d7
extb.l